package com.donleo.amqp.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liangd
 * date 2020-12-12 10:46
 * code rabbitmq配置类
 */
@Configuration
public class AmqpConfig {
    /**
     * 将消息体转换为json
     * @return Jackson2JsonMessageConverter
     */
    @Bean
    public MessageConverter messageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
